<%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2015/3/25
  Time: 17:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
    <script type="text/javascript" src="<%=request.getContextPath() %>/resources/js/jquery.min.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath() %>/resources/js/highcharts.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath() %>/resources/js/exporting.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            var options = {
                chart: {
                    renderTo: 'container', //DIV容器ID
                    type: 'line'//报表类型
                },
                title: {
                    text: '本月销售额统计'

                },
                subtitle: {
                    text: ''
                },
                yAxis: {
                    title: {
                        text: '销售额(￥)'
                    },
                    plotLines: [{
                        value: 0,
                        width: 1,
                        color: '#808080'
                    }]
                },
                tooltip: {
                    enabled: false,
                    formatter: function() {
                        return '<b>'+ this.series.name +'</b><br>'+this.x +': '+ this.y +'°C';
                    }
                },
                plotOptions: {
                    line: {
                        dataLabels: {
                            enabled: true
                        },
                        enableMouseTracking: false
                    }
                },
            //x轴显示内容
            xAxis: {
                categories: []
            },
//            series: [{},{}]
                series: [{ }]
        };
        //json url 地址这里我使用的servlet
        var url =  "http://localhost:8888/MicroMart/seller/monthSta";
        $.getJSON(url,function(data) {

            options.series[0].data = data.moneyList;
            options.series[0].name ="Sales";
            options.xAxis.categories=data.day;
            options.subtitle.text=data.total+"元";
            var chart = new Highcharts.Chart(options);
//        });
        });})
    </script>
</head>
<body>
<div id="container" style="height: 500px; min-width: 300px"></div>
</body>
</html>
